<?php
  
class EmailControl extends Control {
	
	private $email;
	public function __construct(Email $email){ $this->email = $email; }
	
	public function Render(){
		$ui = $this->email->GetUIObject();
		$z = FieldTableControl::Make()->WithWidth('100%');
		$z->Add(LiteralControl::Make($ui->DateSent)->WithFormat('D d/m/Y H:i'));
		$z->Add(LiteralControl::Make($ui->From));
		$z->Add(LiteralControl::Make($ui->Rcpt));
		$z->Add(LiteralControl::Make($ui->Subject));
		$z->Add($ui->Body)->Write('<div style="border:1px solid #999999;padding:5px;background:#ffffff;">'.$this->email->Body.'</div>');
		$z->Render();

	}
}

?>
